home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / tclX6.4c / sun4.md / Makefile.sprite < prev    next >
Encoding:
Makefile  |  1992-12-04  |  5.8 KB  |  163 lines

  1. #
  2. # Makefile --
  3. #
  4. # Makefile for Extended Tcl.  This requires Tcl 6.1 or Tcl 6.2 from Berkeley,
  5. # which should be compiled before running this makefile.  Its location is
  6. # configured below.
  7. #------------------------------------------------------------------------------
  8. # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
  9. #
  10. # Permission to use, copy, modify, and distribute this software and its
  11. # documentation for any purpose and without fee is hereby granted, provided
  12. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  13. # Mark Diekhans make no representations about the suitability of this
  14. # software for any purpose.  It is provided "as is" without express or
  15. # implied warranty.
  16. #------------------------------------------------------------------------------
  17. # $Id: Makefile,v 1.1 92/12/03 12:00:53 jhh Exp Locker: jhh $
  18. #------------------------------------------------------------------------------
  19. #
  20.  
  21. #include "Config.mk"
  22. #include "config/$(TCL_CONFIG_FILE)"
  23. SHELL=/bin/sh
  24.  
  25. #------------------------------------------------------------------------------
  26.  
  27. # List of files that are touched by secondary makefiles when something changes.
  28.  
  29. MADE.FILES=ucbsrc/made.tmp osSupport/made.tmp src/made.tmp
  30. TKMADE.FILES=tkucbsrc/made.tmp
  31.  
  32. CFLAGS= $(OPTIMIZE_FLAG) $(XCFLAGS) -I$(TCL_UCB_DIR) $(MEM_DEBUG_FLAGS) \
  33.         $(SYS_DEP_FLAGS)
  34.  
  35. #------------------------------------------------------------------------------
  36.  
  37. default all: tcl TCLDEFAULT $(TCL_TK_SHELL) 
  38.  
  39.  
  40. #------------------------------------------------------------------------------
  41. # Compile the Extended Tcl library and link the Tcl shell.
  42. #
  43.  
  44. tcl: TCLX_MAKES runtcl
  45.  
  46. TCLX_MAKES: libtcl.a
  47.     cd ucbsrc;    $(MAKE) $(MAKEFLAGS) all
  48.     cd osSupport; $(MAKE) $(MAKEFLAGS) all
  49.     cd tclsrc;    $(MAKE) $(MAKEFLAGS) all
  50.     cd src;       $(MAKE) $(MAKEFLAGS) all
  51.  
  52.  
  53. # Copy the UCB libtcl.a file from where it was built.  Force the other
  54. # Makefiles to add their .o files to the library by nuking their made.tmp file.
  55.  
  56. libtcl.a: $(TCL_UCB_DIR)/libtcl.a
  57.     cp $(TCL_UCB_DIR)/libtcl.a .
  58.     rm -f  $(MADE.FILES)
  59.  
  60. #------------------------------------------------------------------------------
  61. # Generate a libtk.a with extensions and a wish shell with Extended Tcl
  62. # commands.
  63. #
  64.  
  65. $(TCL_TK_SHELL): TKX_MAKES runwish
  66. TKX_MAKES: libtk.a tcl
  67.     cd tkucbsrc; $(MAKE) $(MAKEFLAGS) all
  68.     cd tksrc;    $(MAKE) $(MAKEFLAGS) all
  69.  
  70.  
  71. # Copy the UCB libtk.a file.  Force the other Makefiles to add their
  72. # .o files to the library by nuking their made.tmp file.
  73.  
  74. libtk.a: $(TCL_TK_DIR)/libtk.a
  75.     cp $(TCL_TK_DIR)/libtk.a libtk.a
  76.     rm -f $(TKMADE.FILES)
  77.  
  78.  
  79. #------------------------------------------------------------------------------
  80. # Generate a temporary TCLDEFAULT file so Tcl can be run in this directory.
  81. # Also generate a script to point the TCLDEFAULT environment variable
  82. # at this file for testing Tcl before its installed.
  83.  
  84. TCLDEFAULT:
  85.     @echo "    -       Generating temporary TCLDEFAULT file.     -"
  86.     @echo "    - Use runtcl script to test Tcl before installing -"
  87.     @echo "    - Use runwish script to test Tk before installing -"
  88.     @echo '# Temporary TCLDEFAULT file for debugging'  >TCLDEFAULT
  89.     @echo "set TCLPATH `pwd`/tcllib"                  >>TCLDEFAULT
  90.     @echo "set TCLINIT `pwd`/tcllib/TclInit.tcl"      >>TCLDEFAULT
  91.  
  92. runtcl: TCLDEFAULT
  93.     @echo ':'                                              >runtcl
  94.     @echo '# script for testing Tcl before installation'  >>runtcl
  95.     @echo "TCLDEFAULT=`pwd`/TCLDEFAULT"                   >>runtcl
  96.     @echo "export TCLDEFAULT"                             >>runtcl
  97.     @echo "if [ \$$# = 0 ]"                               >>runtcl
  98.     @echo "then"                                          >>runtcl
  99.     @echo "    exec `pwd`/tcl"                            >>runtcl
  100.     @echo "else"                                          >>runtcl
  101.     @echo "    exec `pwd`/tcl \"\$$@\""                   >>runtcl
  102.     @echo "fi"                                            >>runtcl
  103.     chmod a+rx runtcl
  104.  
  105. runwish: TCLDEFAULT
  106.     @echo ':'                                              >runwish
  107.     @echo '# script for testing wish before installation' >>runwish
  108.     @echo "TCLDEFAULT=`pwd`/TCLDEFAULT"                   >>runwish
  109.     @echo "export TCLDEFAULT"                             >>runwish
  110.     @echo "if [ \$$# = 0 ]"                               >>runwish
  111.     @echo "then"                                          >>runwish
  112.     @echo "    exec `pwd`/"$(TCL_TK_SHELL)                >>runwish
  113.     @echo "else"                                          >>runwish
  114.     @echo "    exec `pwd`/"$(TCL_TK_SHELL)" \"\$$@\""     >>runwish
  115.     @echo "fi"                                            >>runwish
  116.     chmod a+rx runwish
  117.  
  118. #------------------------------------------------------------------------------
  119. #
  120. #  just test to see if the C++ include file compiles and links
  121.  
  122. tcl++:
  123.     cd src;$(MAKE) $(MAKEFLAGS) TCL++
  124.  
  125. #------------------------------------------------------------------------------
  126. #
  127. # Run the UCB and Extended Tcl tests.
  128.  
  129. test: ucbtests extdtests
  130.  
  131. ucbtests: all
  132.     @echo ""
  133.     @echo "**************************************************"
  134.     @echo "* Ignore failures in tests:  expr-2.2 & expr-2.6 *"
  135.     @echo "**************************************************"
  136.     @echo ""
  137.     ./runtcl -c "cd $(TCL_UCB_DIR)/tests;source all"
  138.  
  139. extdtests: all
  140.     ./runtcl -c "cd tests;source all"    
  141.  
  142. #------------------------------------------------------------------------------
  143. # Install Tcl.
  144.  
  145. install: all
  146.     ./runtcl tclsrc/installTcl.tcl
  147.     update man/*.man /sprite/man/lib/tclX
  148.     update man/TclX.man /sprite/man/cmds
  149.  
  150.  
  151. #------------------------------------------------------------------------------
  152. # Clean up the mess we made.
  153.  
  154. clean:
  155.     cd ucbsrc;    $(MAKE) $(MAKEFLAGS) clean
  156.     cd osSupport; $(MAKE) $(MAKEFLAGS) clean
  157.     cd src;       $(MAKE) $(MAKEFLAGS) clean
  158.     cd tclsrc;    $(MAKE) $(MAKEFLAGS) clean
  159.     cd tkucbsrc;  $(MAKE) $(MAKEFLAGS) clean
  160.     cd tksrc;     $(MAKE) $(MAKEFLAGS) clean
  161.     -rm -f libtcl.a TCLDEFAULT libtk.a runtcl runwish
  162.